@use "sass:color";
@use "sass:math";

@use '../tools/colors';
@use '../tools/variables';

$notification--sub-heading--color: color.adjust(color.adjust(#7189a8, $lightness: 5%), $saturation: 5%);

.notifications {
  &--empty {
    text-align: center;
  }

  &--is-loading {
    .notifications {
      &__list {
        opacity: 0.25;
      }

      &__loading-indicator {
        opacity: 1;
      }
    }
  }

  &__badge {
    background: colors.$blue;
    border-radius: 30px;
    color: colors.$dark-blue;
    font-size: 0.5rem;
    font-weight: 700;
    left: 18px;
    line-height: 9px;
    padding: 0 math.div(variables.$spacing-unit * 1, 10);
    position: absolute;
    top: 6px;
    vertical-align: baseline;
  }

  &__list {
    min-height: 30px;
    opacity: 1;
    position: relative;
    transition: opacity 0.25s;
    white-space: normal;
    word-wrap: break-word;

    &__item {
      margin-bottom: math.div(variables.$spacing-unit * 3, 10);

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  &__loading-indicator {
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s;

    .icon {
      height: 24px;
      width: 24px;

      .loading-indicator {
        &--dots {
          &__dot {
            fill: currentColor;
          }
        }
      }
    }
  }

  &__toolbar {
    .toolbar {
      &__item {
        &--button {
          flex-basis: 33.33%;
        }
      }
    }
  }
}

.notification {
  &__heading {
    color: #495d76;
    font-size: 0.75rem;
  }

  &__category {
    color: colors.$blue;
    font-weight: 600;
  }

  &__message {
    &__sub-heading {
      color: $notification--sub-heading--color;
      font-style: italic;
    }
  }
}
